package com.junjie.checkin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.junjie.checkin.entity.TGift;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author 洪浚杰
 * @description
 * @date 2025/6/16 09:42
 */
@Mapper
public interface GiftMapper  extends BaseMapper<TGift> {
    /**
     * 分页查询礼品信息
     * @param status 礼品状态
     * @param name 礼品名称
     * @return 礼品信息列表
     */
    Page<TGift> pageQueryAdmin(@Param("status")String status,@Param("name")String name);

    @Select("select * from t_gift where id = #{id}")
    TGift selectById(@Param("id")Integer id);

    @Update("update t_gift set status = 2,disable = 1,update_by = #{updateBy} where id = #{id}")
    int deleteById(TGift gift);

    Page<TGift> pageQuery(@Param("name")String name);


}
